﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AvansRS.Web.Service;

namespace AvansRS.Web.Util
{
    public class AvansAuthorizeAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            string name = filterContext.HttpContext.User.Identity.Name;
            AuthorizationService service = new AuthorizationService();
            service.Authorize(name, filterContext.Controller.ToString());
        }
    }
}
